package com._520it.wms.util;

import java.util.Calendar;
import java.util.Date;

//日期处理帮助类
public class DateUtil {

    public static Date  getStart(Date current){
        if(current==null){
            return null;
        }
        Calendar instance = Calendar.getInstance();
        instance.setTime(current);
        instance.set(Calendar.HOUR_OF_DAY,0);
        instance.set(Calendar.MINUTE,0);
        instance.set(Calendar.SECOND,0);
        return  instance.getTime();
    }

    public static Date getEnd(Date current){
        if(current==null){
            return null;
        }
        Calendar instance = Calendar.getInstance();
        instance.setTime(current);
        instance.set(Calendar.HOUR_OF_DAY,23);
        instance.set(Calendar.MINUTE,59);
        instance.set(Calendar.SECOND,59);
        return  instance.getTime();
    }
}
